<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>案例5</title>
		<script>
			var animal={
				weight:30,
				age:3,
				vary:"狗",
					eat:function(){
						alert("我会吃薯条")
					},
					sleep:function(){
						alert("我会睡大觉")
					},
					play:function(){
						alert("我会玩皮球")
						}
						}
					console.log(animal);
					animal.eat();
					animal.sleep();
					animal.play();
		</script>
	</head>
	<body>
		<input class="animal.eat()" />
		<button onclick="animal.play()">玩游戏</button>
		<button ondblclick="animal.sleep()">睡觉觉</button>
	</body>
</html>
